home *** CD-ROM | disk | FTP | other *** search
Korn shell script | 1997-02-07 | 1.3 KB | 77 lines |
- #!/bin/ksh
- #
- # Simple script to fire up the MPI launcher
- #
-
- Launcher=/usr/bin/mpiview
- Usage="ampi <origin> <display> <cwd> <array name> [<envvar> <value>]..."
-
- #
- # Make sure enough args were specified
- #
- if [ "$#" -lt 4 ]; then
- echo "Incorrect number of arguments to $0"
- echo $Usage
- exit 1
- fi
-
- #
- # Give command line args more meaningful names
- #
- Origin=$1
- DISPLAY=$2
- Cwd=$3
- Array=$4
- shift 4
-
- #
- # Set some relevant environment variables that xwsh doesn't handle
- #
- eval HOME=~$LOGNAME
- export DISPLAY HOME
-
- #
- # Set any caller-specified environment variables
- #
- while [ $# -gt 1 ]; do
- VarName=$1
- VarValue=$2
-
- if [ "$VarName" = "MPIRUN_DIR" -a "$VarValue" = "." ]; then
- if [ "$Cwd" != "<>" ]; then
- VarValue=$Cwd
- fi
- fi
-
- eval "export $VarName="'"'$VarValue'"'
- shift 2
- done
-
- #
- # If MPIview is not installed, quit now
- #
- if [ ! -x $Launcher ]; then
- /usr/bin/X11/xconfirm \
- -c \
- -header "Launch MPI Job" \
- -t "Sorry, the MPI job launcher $Launcher is not installed" \
- -icon error \
- > /dev/null
- exit 1
- fi
-
- #
- # Invoke MPIview from an xwsh so that console input & output are available
- #
- exec /usr/sbin/xwsh \
- -fn "-*-screen-medium-r-normal--12-*-*-*-m-70-iso8859-1" \
- -geometry 80x24 \
- -holdonerror \
- -iconic \
- -name MPIviewCons \
- -title "MPIview console" \
- -ut \
- -e $Launcher -array $Array
-
- exit 0
-